package com.ctsi.security.domain;

import com.ctsi.framework.common.startrun.ComponentFactory;
import com.ctsi.security.FetchObjIds;
import com.ctsi.security.manager.impl.SecurityImpl;

public class DataObjectType implements java.io.Serializable{
	/**
	 * serialVersionUID
	 */
	public static final int FORBIDDEN=1;

	private static final long serialVersionUID = 539774013563506097L;
	private String id;
	private String dataObjectTypeId;
	private String dataObjectTypeName;
	private String description;
	private String actionDic;
	private String secretTypeId;
	private Integer status;
	private String category;

	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getDataObjectTypeId() {
		return dataObjectTypeId;
	}
	public void setDataObjectTypeId(String dataObjectTypeId) {
		this.dataObjectTypeId = dataObjectTypeId;
	}
	public String getDataObjectTypeName() {
		return dataObjectTypeName;
	}
	public void setDataObjectTypeName(String dataObjectTypeName) {
		this.dataObjectTypeName = dataObjectTypeName;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	/**
	 * @param category the category to set
	 */
	public void setCategory(String category) {
		this.category = category;
	}
	/**
	 * @return the category
	 */
	public String getCategory() {
		return category;
	}
	/**
	 * 判断是扩展类型还是内置类型
	 * @return
	 */
	public boolean isInner(){
		if(category==null){
			return true;
		}
		//return !(category!=0);
		return "0".equals(category);
	}

	public FetchObjIds getFetchObjIds(){
		if(isInner()){
			return null;
		}
		SecurityImpl security = (SecurityImpl) ComponentFactory.getBean("iSecurity");
		return security.getObjIds().get(category);
		
	}
	public String getActionDic() {
		return actionDic;
	}
	public void setActionDic(String actionDic) {
		this.actionDic = actionDic;
	}
	public String getSecretTypeId() {
		return secretTypeId;
	}
	public void setSecretTypeId(String secretTypeId) {
		this.secretTypeId = secretTypeId;
	}


}
